package com.example.ujsfish.model;


import java.util.ArrayList;
import java.util.List;

public class PlanPoint {

    private String pool_id;
    private String path_id;
    private String userName;
    private List<PlanPointBody> planPointBodyList = new ArrayList<>();


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPool_id() {
        return pool_id;
    }

    public void setPool_id(String pool_id) {
        this.pool_id = pool_id;
    }

    public String getPath_id() {
        return path_id;
    }

    public void setPath_id(String path_id) {
        this.path_id = path_id;
    }

    public List<PlanPointBody> getPlanPointBodyList() {
        return planPointBodyList;
    }

    public void setPlanPointBodyList(List<PlanPointBody> planPointBodyList) {
        this.planPointBodyList = planPointBodyList;
    }
    public boolean isHasPoint(Integer order) {
        if (planPointBodyList != null) {
            for (PlanPointBody planPointBody : planPointBodyList) {
                if (Integer.valueOf(planPointBody.getNode_id()).equals(order)) return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        return "PlanPoint{" +
                "pool_id='" + pool_id + '\'' +
                ", path_id='" + path_id + '\'' +
                ", userName='" + userName + '\'' +
                ", planPointBodyList=" + planPointBodyList +
                '}';
    }

    public void clear() {
        this.pool_id = "";
        this.path_id = "";
        this.userName = "";
        this.planPointBodyList.clear();
    }
}
